package rs.frenjoynet.core.ui.servlet;

import cz.atria.common.jsf.core.servlet.ExceptionHandlerFacesServlet;

import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;
import javax.faces.application.ViewExpiredException;
import java.util.List;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: 22.10.2009.
 * Time: 12.31.48
 * To change this template use File | Settings | File Templates.
 */

public class UtilisServlet extends ExceptionHandlerFacesServlet implements Servlet
{
	private static final String DEFAULT_PATH = "/index.jsf";

	public String getDefaultPath(HttpServletRequest httpServletRequest)
	{
		return httpServletRequest.getContextPath() + DEFAULT_PATH;
	}

	public List<Class<? extends Throwable>> getExceptionsToCatch()
	{
		List<Class<? extends Throwable>> exceptions = new ArrayList<Class<? extends Throwable>>();
		exceptions.add(ViewExpiredException.class);
		return exceptions;
	}

	@Override
	protected boolean isUseDefaultPath()
	{
		return false;
	}
}
